Check for click in keyboardBox rather than Main.keyboard.actor, since
the latter won't exist when the keyboard is hidden.
https://bugzilla.gnome.org/show_bug.cgi?id=658598
let source = event.get_source();
switch (event.type()) {
case Clutter.EventType.BUTTON_PRESS:
- if (!this.actor.contains(source) && !Main.keyboard.actor.contains(source))
+ if (!this.actor.contains(source) &&
+ !Main.layoutManager.keyboardBox.contains(source))
this.emit('button-pressed', source);
break;
case Clutter.EventType.KEY_PRESS: